package sealte.mynode.db;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import sealte.util.database.conn.DBINFOReader;

public class DBConnection {
	
	private static final String configXMLPath = DBConnection.class.getResource("").getPath()+"dbinfo.xml";
	private static final String connName = "MYSQL";
	private static DBINFOReader info = null;
	
	static{
		info = new DBINFOReader(configXMLPath,connName);
		try {
			info.doInitialize();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private DBConnection(){}
	
	public static Connection getConnection() throws Exception {
		return info.getConnection();
	}
	
	public static void close(ResultSet rs,PreparedStatement ps,Connection conn){
		DBINFOReader.close(rs, ps, conn);
	}
	
}
